package com.yxb.orders.service.impl;

import java.util.Collections;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yxb.orders.mapper.MyOrdersMapper;
import com.yxb.orders.domain.MyOrders;
import com.yxb.orders.service.IMyOrdersService;

/**
 * 我的接单Service业务层处理
 * 
 * @author 林德炫
 * @date 2025-03-29
 */
@Service
public class MyOrdersServiceImpl implements IMyOrdersService 
{
    @Autowired
    private MyOrdersMapper myOrdersMapper;

    /**
     * 查询我的接单
     * 
     * @param orderId 我的接单主键
     * @return 我的接单
     */
    @Override
    public MyOrders selectMyOrdersByOrderId(Long orderId)
    {
        return myOrdersMapper.selectMyOrdersByOrderId(orderId);
    }

    /**
     * 查询我的接单列表
     * 
     * @param myOrders 我的接单
     * @return 我的接单
     */
    @Override
    public List<MyOrders> selectMyOrdersList(MyOrders myOrders)
    {
        return myOrdersMapper.selectMyOrdersList(myOrders);
    }

    /**
     * 新增我的接单
     * 
     * @param myOrders 我的接单
     * @return 结果
     */
    @Override
    public int insertMyOrders(MyOrders myOrders)
    {
        return myOrdersMapper.insertMyOrders(myOrders);
    }

    /**
     * 修改我的接单
     * 
     * @param myOrders 我的接单
     * @return 结果
     */
    @Override
    public int updateMyOrders(MyOrders myOrders)
    {
        return myOrdersMapper.updateMyOrders(myOrders);
    }

    /**
     * 批量删除我的接单
     * 
     * @param orderIds 需要删除的我的接单主键
     * @return 结果
     */
    @Override
    public int deleteMyOrdersByOrderIds(Long[] orderIds)
    {
        return myOrdersMapper.deleteMyOrdersByOrderIds(orderIds);
    }

    /**
     * 删除我的接单信息
     * 
     * @param orderId 我的接单主键
     * @return 结果
     */
    @Override
    public int deleteMyOrdersByOrderId(Long orderId)
    {
        return myOrdersMapper.deleteMyOrdersByOrderId(orderId);
    }

    @Override
    public List<MyOrders> listSquareById(Long userId) {
//        System.out.println("userId:"+userId+"listSquareById"+myOrdersMapper.listSquareById());
        return myOrdersMapper.listSquareById(userId);
    }
}
